package com.freemyleft.left.left_app.mian.index.work.allcourses.adapter;

import com.freemyleft.left.left_app.R;
import com.freemyleft.left.zapp.ui.recycler.MultipleItemEntity;
import com.freemyleft.left.zapp.ui.recycler.MultipleRecyclerAdapter;
import com.freemyleft.left.zapp.ui.recycler.MultipleViewHolder;

import java.util.List;

public class CourserAdapter extends MultipleRecyclerAdapter {
    public static final int COURSER_TYPE=958;

    public CourserAdapter(List<MultipleItemEntity> data) {
        super(data);
        addItemType(COURSER_TYPE, R.layout.item_courser);

    }

    @Override
    protected void convert(MultipleViewHolder holder, MultipleItemEntity entity) {
        super.convert(holder, entity);
        String name=entity.getField(CourserFlies.NAME);
        String time=entity.getField(CourserFlies.TIME);
        String subject=entity.getField(CourserFlies.SUBJECT);
        String week=entity.getField(CourserFlies.WEEK);
        String date=entity.getField(CourserFlies.DATE);
        holder.setText(R.id.tv_week,week);
        holder.setText(R.id.tv_date,date);
        holder.setText(R.id.tv_time,time);
        holder.setText(R.id.tv_name,name);
        holder.setText(R.id.tv_subject,subject);
    }

    public enum CourserFlies {
        DATE,
        TIME,
        SUBJECT,
        NAME,
        WEEK


    }
}
